const app = getApp()
import { fetch } from '../../../api/order'

Page({
  data: {
    back: true,
    title: '核销',
    loading: true,
    order: false
  },
  onLoad(options) {
    this.setData({ loading: true })
    fetch(options.id).then(res => {
      this.setData({ order: res.data })
    })
      .catch(error => {
        app.toast(error.msg)
      })
      .finally(() => {
        this.setData({ loading: false })
      });
  },
  onShow() { },
  onPullDownRefresh() {/*监听用户下拉动作*/ },
  onReachBottom() {/*页面上拉触底事件的处理函数*/ },
  onShareAppMessage(event) {},

  goHome () {
    wx.reLaunch({
      url: '/pages/index/index'
    })
  }
})